import request from '@/utils/request'
import type { LoginResponseData, UserResponseData } from './type'

// 统一管理接口
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout'
}
// 登录接口
export const reqLogin = (data: any) =>
  request.post<any, LoginResponseData>(API.LOGIN_URL, data)

// 获取用户信息
export const reqUserInfo = () =>
  request.get<any, UserResponseData>(API.USERINFO_URL)

// 退出登录
export const reqLogout = () => request.post(API.LOGOUT_URL)
